package com.netease.task.service.impl;

import com.netease.task.dao.OrderMapper;
import com.netease.task.meta.Order;
import com.netease.task.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public List<Order> getOrders() {
        return orderMapper.getOrders();
    }

    @Override
    public int addOrder(Order order) {
        return orderMapper.addOrder(order);
    }

    @Override
    public Order getOrderByBookId(Integer bookId) {
        return orderMapper.getOrderByBookId(bookId);
    }

    @Override
    public int updateOrderByBookId(Integer bookId, Integer num) {
        return orderMapper.updateOrderByBookId(bookId,num);
    }

    @Override
    public List<Order> getOrderByType(Integer isComplete) {
        return orderMapper.getOrderByType(isComplete);
    }

    @Override
    public int updateIsComplete(Date date) {
        return orderMapper.updateIsComplete(date);
    }
}
